package com.ruoyi.cms.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cms.mapper.CmsHelpMapper;
import com.ruoyi.cms.domain.CmsHelp;
import com.ruoyi.cms.service.ICmsHelpService;

/**
 * 帮助文档Service业务层处理
 * 
 * @author zouhuu
 * @date 2022-08-04
 */
@Service
public class CmsHelpServiceImpl implements ICmsHelpService 
{
    @Autowired
    private CmsHelpMapper cmsHelpMapper;

    /**
     * 查询帮助文档
     * 
     * @param id 帮助文档主键
     * @return 帮助文档
     */
    @Override
    public CmsHelp selectCmsHelpById(Long id)
    {
        return cmsHelpMapper.selectCmsHelpById(id);
    }

    /**
     * 查询帮助文档列表
     * 
     * @param cmsHelp 帮助文档
     * @return 帮助文档
     */
    @Override
    public List<CmsHelp> selectCmsHelpList(CmsHelp cmsHelp)
    {
        return cmsHelpMapper.selectCmsHelpList(cmsHelp);
    }

    /**
     * 新增帮助文档
     * 
     * @param cmsHelp 帮助文档
     * @return 结果
     */
    @Override
    public int insertCmsHelp(CmsHelp cmsHelp)
    {
        cmsHelp.setCreateTime(DateUtils.getNowDate());
        return cmsHelpMapper.insertCmsHelp(cmsHelp);
    }

    /**
     * 修改帮助文档
     * 
     * @param cmsHelp 帮助文档
     * @return 结果
     */
    @Override
    public int updateCmsHelp(CmsHelp cmsHelp)
    {
        cmsHelp.setUpdateTime(DateUtils.getNowDate());
        return cmsHelpMapper.updateCmsHelp(cmsHelp);
    }

    /**
     * 批量删除帮助文档
     * 
     * @param ids 需要删除的帮助文档主键
     * @return 结果
     */
    @Override
    public int deleteCmsHelpByIds(Long[] ids)
    {
        return cmsHelpMapper.deleteCmsHelpByIds(ids);
    }

    /**
     * 删除帮助文档信息
     * 
     * @param id 帮助文档主键
     * @return 结果
     */
    @Override
    public int deleteCmsHelpById(Long id)
    {
        return cmsHelpMapper.deleteCmsHelpById(id);
    }
}
